const path = require("path");
function resolve(dir) {
  return path.join(__dirname, dir);
}
module.exports = {
  configureWebpack: {
    resolve: {
      alias: {
        "@": resolve("src"),
        assets: resolve("src/assets"),
        components: resolve("src/components"),
        views: resolve("src/views"),
      },
    },
  },
  css: {
    loaderOptions: {
      sass: {
        prependData: `@import "@/assets/css/base.scss";`,
      },
    },
  },

  // devServer: {
  //     host: '0.0.0.0',
  //     port: 8080,
  //     proxy: {
  //       [process.env.VUE_APP_BASE_PATH]: {
  //         target: ``,
  //         changeOrigin: true,
  //         //secure: false,
  //         pathRewrite: {
  //           ['^' + process.env.VUE_APP_BASE_PATH]: ''
  //         }
  //       }
  //     },
  //     disableHostCheck: true // 关闭host检查
  //   },

  // 资源打包路径，请按需更改
  publicPath: process.env.NODE_ENV === 'production' ? '/chuandong' : process.env.NODE_ENV === 'staging' ? '/chuandong' : './'
};
